package routers

import (
	v1 "blog/api/v1"
	"blog/middleware"
	"github.com/gin-gonic/gin"
)

func InitCategoryRouter(Router *gin.RouterGroup) {
	categoryRouter := Router.Group("")
	categoryRouter.Use(middleware.JwtToken())
	{
		//分类模块
		categoryRouter.POST("category/add", v1.AddCategory)
		categoryRouter.PUT("category/:id", v1.EditCategory)
		categoryRouter.DELETE("category/:id", v1.DeleteCategory)
	}
	router := Router.Group("")
	{
		router.GET("categories", v1.GetCategories)
	}
}
